package com.fr.report.highlight;

import com.fr.base.FCloneable;
import com.fr.base.xml.XMLPrintWriter;
import com.fr.base.xml.XMLableReader;
import com.fr.report.CellElement;
import com.fr.report.cellElement.Present;
import com.fr.report.io.xml.ReportXMLUtils;
import com.fr.report.script.Calculator;

public class PresentHighlightAction extends AbstractHighlightAction
{
  private Present present;

  public PresentHighlightAction()
  {
  }

  public PresentHighlightAction(Present paramPresent)
  {
    this.present = paramPresent;
  }

  public Present getPresent()
  {
    return this.present;
  }

  public void setPresent(Present paramPresent)
  {
    this.present = paramPresent;
  }

  public void action(CellElement paramCellElement, Calculator paramCalculator)
  {
    if ((paramCellElement == null) || (this.present == null))
      return;
    paramCellElement.setPresent(this.present);
  }

  public Object clone()
    throws CloneNotSupportedException
  {
    PresentHighlightAction localPresentHighlightAction = (PresentHighlightAction)super.clone();
    if (this.present != null)
      localPresentHighlightAction.present = ((Present)this.present.clone());
    return localPresentHighlightAction;
  }

  public void readXML(XMLableReader paramXMLableReader)
  {
    if (paramXMLableReader.isChildNode())
    {
      String str = paramXMLableReader.getTagName();
      if ("Present".equals(str))
        setPresent(ReportXMLUtils.readPresent(paramXMLableReader));
    }
  }

  public void writeXML(XMLPrintWriter paramXMLPrintWriter)
  {
    if (this.present == null)
      return;
    ReportXMLUtils.writeXMLable(paramXMLPrintWriter, this.present, "Present");
  }
}